import { request } from '@boeyo/portal';

/**
 * 查询数据来源列表
 * @ss.hasPermi('informationSourceManage:list')
 */
export const list = (params) => {
  return request({
    url: 'informationSourceManage/list',
    method: 'GET',
    params,
  });
};

/**
 * 删除数据源
 * @ss.hasPermi('informationSourceManage:remove')
 */
export const remove = (sourceTotalIds) => {
  return request({
    url: `informationSourceManage/remove/${sourceTotalIds}`,
    method: 'DELETE',
  });
};

/**
 * 连接数据源
 * @ss.hasPermi('informationSourceManage:connection')
 */
export const connection = (params) => {
  return request({
    url: 'informationSourceManage/connection',
    method: 'GET',
    params,
  });
};

/**
 * 数据来源详情查询
 * @ss.hasPermi('informationSourceManage:detail')
 */
export const detail = (sourceTotalId) => {
  return request({
    url: `informationSourceManage/queryById/${sourceTotalId}`,
    method: 'GET',
  });
};

/**
 * 新增数据来源
 * @ss.hasPermi('informationSourceManage:add')
 */
export const add = (data) => {
  return request({
    url: 'informationSourceManage/add',
    method: 'POST',
    data,
  });
};

/**
 * 修改数据来源
 * @ss.hasPermi('informationSourceManage:update')
 */
export const edit = (data) => {
  return request({
    url: 'informationSourceManage/update',
    method: 'PUT',
    data,
  });
};
